import axios from 'axios'
import apiUrls from 'common/api-urls'
import { contentTypeWww, headerToken } from 'common/axio-decorate'
import { getOPTokenFromCookie } from 'common/auth'

export function quickLogin(data) {
  data = JSON.parse(JSON.stringify(data))
  return axios.post(`${apiUrls.quickLogin}/${data.id}`, data, {
    headers: {
      'Content-Type': contentTypeWww,
      [headerToken]: getOPTokenFromCookie()
    }
  })
}

export function getAuthInfo(token) {
  return axios.get(`${apiUrls.getAuthInfo}`, {
    params: {},
    headers: {
      [headerToken]: token
    }
  })
}
